package p2000;

import java.util.Scanner;

public class Main2007平方和与立方和 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int m = scanner.nextInt();
            int n = scanner.nextInt();
            int sum1 = 0;
            int sum2 = 0;

            if (m > n) {
                int x = m;
                m = n;
                n = x;
            }

            for (int i = m; i <= n; i++) {
                if (i % 2 == 0) {
                    sum1 += i * i;
                } else {
                    sum2 += i * i * i;
                }
            }

            System.out.print(sum1 + " ");
            System.out.println(sum2);
        }
    }

}
